<!--
 * @Descripttion: 
 * @Author: Wang Dejiang(aei)
 * @Date: 2022-07-23 00:00:59
 * @LastEditors: Wang Dejiang(aei)
 * @LastEditTime: 2022-07-23 00:25:52
-->
<template>
  <div class="mycontainre">
    <div id="main"></div>
    <div id="main_l"></div>
    <hr />
    <div id="main_ll"></div>
  </div>
</template>

<script>
export default {
  name: 'Test7_Echarts',
  data() {
    return {
      option: {
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            areaStyle: {}
          }
        ]
      },
      option1: {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Test']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            smooth: true
          }
        ]
      },
      option2: {
        title: {
          text: 'World Population'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        legend: {},
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'value',
          boundaryGap: [0, 0.01]
        },
        yAxis: {
          type: 'category',
          data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
        },
        series: [
          {
            name: '2011',
            type: 'bar',
            data: [18203, 23489, 29034, 104970, 131744, 630230]
          },
          {
            name: '2012',
            type: 'bar',
            data: [19325, 23438, 31000, 121594, 134141, 681807]
          }
        ]
      }
    }
  },
  methods: {
    initEcharts() {
      this.$echarts
        .init(document.getElementById('main_l'))
        .setOption(this.option)
      this.$echarts
        .init(document.getElementById('main_ll'))
        .setOption(this.option1)
      this.$echarts
        .init(document.getElementById('main'))
        .setOption(this.option2)
    }
  },
  mounted() {
    this.initEcharts()
  }
}
</script>

<style>
.mycontainre {
  height: 100%;
}
#main {
  width: 100%;
  height: 100%;
}
#main:first-child {
  width: 100%;
}
#main_l {
  width: 100%;
  height: 100%;
}
#main_ll {
  width: 100%;
  height: 100%;
}
</style>
